Skip to content

feat(aliases): add admin setting to disable alias creation#12764

Open
bromiesTM wants to merge 1 commit intonextcloud:mainfrom
IONOS-Productivity:feature/configure-alias-creation
Open

feat(aliases): add admin setting to disable alias creation#12764
bromiesTM wants to merge 1 commit intonextcloud:mainfrom
IONOS-Productivity:feature/configure-alias-creation

Conversation

@bromiesTM
Copy link
Copy Markdown

@bromiesTM bromiesTM commented Apr 16, 2026

Introduces an allow_new_mail_aliases app config flag (default: yes) that lets administrators prevent users from creating new mail aliases. This is useful for providers who want to prevent alias creation or manage it elsewhere.

  • Backend: guard in AliasesService::create() throws ClientException when disabled
  • Admin UI: toggle switch in AdminSettings, mirroring the existing "allow new mail accounts" setting
  • Frontend: hides the "Add alias" button when disabled + (warning) description for setting
  • Exposed via PageController initial state and storable via occ config:app:set

Extends existing unit tests for AliasesService, AdminSettings, and PageController to cover the new setting.

@ChristophWurst
Copy link
Copy Markdown
Member

Thank you for sending a pull request

@ChristophWurst
Copy link
Copy Markdown
Member

Please point your agent to https://github.com/nextcloud/mail/blob/main/AGENTS.md#git-workflow in case you didn't open it from this repo's root. Agentic AI has to be transparent in commit messages.

@bromiesTM bromiesTM force-pushed the feature/configure-alias-creation branch 2 times, most recently from 93543cf to eea743b Compare April 16, 2026 12:50
Comment thread src/components/AccountSettings.vue Outdated
Copy link
Copy Markdown
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just giving the design-ok for the record. This is useful for providers who want to prevent alias creation or manage it elsewhere.

@bromiesTM for future pull requests please also always include the use-case or the issue the pull request tackles. That helps with deciding how to go ahead with it. Thank you! :)

@bromiesTM bromiesTM force-pushed the feature/configure-alias-creation branch 2 times, most recently from a7d30b0 to e5a83f4 Compare April 21, 2026 08:04
@bromiesTM bromiesTM marked this pull request as ready for review April 21, 2026 08:27
Introduces an `allow_new_mail_aliases` app config flag (default: yes)
that lets administrators prevent users from creating new mail aliases.

- Backend: guard in AliasesService::create() throws ClientException when disabled
- Admin UI: toggle switch in AdminSettings, mirroring the existing
  "allow new mail accounts" setting
- Frontend: hides the "Add alias" button when disabled
- Exposed via PageController initial state and storable via occ config:app:set

Extends existing unit tests for AliasesService, AdminSettings, and
PageController to cover the new setting.

AI-assisted: Claude Code (Claude Sonnet 4.6)
Co-Authored-By: Kai Henseler <kai.henseler@strato.de>
Signed-off-by: Matthias Sauer <sauerm@strato.de>
@bromiesTM bromiesTM force-pushed the feature/configure-alias-creation branch from e5a83f4 to aca5dd0 Compare April 22, 2026 13:34
@ChristophWurst
Copy link
Copy Markdown
Member

What about the Alias to S/MIME certificate mapping section? It will still be shown when aliases are disabled by the admin. Should it be hidden?

@ChristophWurst
Copy link
Copy Markdown
Member

Tested and works otherwise. Thank you!

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants